package com.lyx.lib_audio.mediaplayer.db;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.lyx.lib_audio.mediaplayer.model.AudioBean;
import com.lyx.lib_audio.mediaplayer.model.Favourite;

import com.lyx.lib_audio.mediaplayer.db.AudioBeanDao;
import com.lyx.lib_audio.mediaplayer.db.FavouriteDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig audioBeanDaoConfig;
    private final DaoConfig favouriteDaoConfig;

    private final AudioBeanDao audioBeanDao;
    private final FavouriteDao favouriteDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        audioBeanDaoConfig = daoConfigMap.get(AudioBeanDao.class).clone();
        audioBeanDaoConfig.initIdentityScope(type);

        favouriteDaoConfig = daoConfigMap.get(FavouriteDao.class).clone();
        favouriteDaoConfig.initIdentityScope(type);

        audioBeanDao = new AudioBeanDao(audioBeanDaoConfig, this);
        favouriteDao = new FavouriteDao(favouriteDaoConfig, this);

        registerDao(AudioBean.class, audioBeanDao);
        registerDao(Favourite.class, favouriteDao);
    }
    
    public void clear() {
        audioBeanDaoConfig.clearIdentityScope();
        favouriteDaoConfig.clearIdentityScope();
    }

    public AudioBeanDao getAudioBeanDao() {
        return audioBeanDao;
    }

    public FavouriteDao getFavouriteDao() {
        return favouriteDao;
    }

}
